home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FLOAT / FPCEIL.ASM < prev    next >
Assembly Source File  |  1989-01-24  |  2KB  |  74 lines

  1. fpceil  ident   2,0
  2. ;
  3. ; MOTOROLA DSP56000/1 FPLIB - VERSION 2
  4. ;
  5. ; This program, originally available on the Motorola DSP bulletin board,
  6. ; is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  7. ; Operation, 6501 William Cannon Drive, West, Austin, Texas  78735-8598.
  8. ;
  9. ; FPCEIL - FLOATING POINT CEIL SUBROUTINE
  10. ;
  11. ; Entry points: fceil_a    R = ceil(A)
  12. ;               fceil_x    R = ceil(X)
  13. ;
  14. ;       m = 24 bit mantissa (two's complement, normalized fraction)
  15. ;
  16. ;       e = 14 bit exponent (unsigned integer, biased by +8191)
  17. ;
  18. ; Input variables:
  19. ;
  20. ;   X   x1 = mx  (normalized)
  21. ;       x0 = ex
  22. ;
  23. ;   A   a2 = sign extension of ma
  24. ;       a1 = ma  (normalized)
  25. ;       a0 = zero
  26. ;
  27. ;       b2 = sign extension of ea (always zero)
  28. ;       b1 = ea
  29. ;       b0 = zero
  30. ;
  31. ; Output variables:
  32. ;
  33. ;   R   a2 = sign extension of mr
  34. ;       a1 = mr  (normalized)
  35. ;       a0 = zero
  36. ;
  37. ;       b2 = sign extension of er (always zero)
  38. ;       b1 = er
  39. ;       b0 = zero
  40. ;
  41. ; Error conditions:     No error conditions are signaled.
  42. ;
  43. ; Assumes n0, m0, shift constant table and scaling modes
  44. ; initialized by previous call to the subroutine "fpinit".
  45. ;
  46. ; Alters Data ALU Registers
  47. ;       a2      a1      a0      a
  48. ;       b2      b1      b0      b
  49. ;       x1      x0
  50. ;
  51. ; Alters Address Registers
  52. ;       r0
  53. ;
  54. ; Alters Program Control Registers
  55. ;       pc      sr
  56. ;       ssh     ssl     sp
  57. ;
  58. ; Uses 1 location on System Stack
  59. ;
  60. ; Version - 2.0
  61. ; Latest Revision - February 22, 1988
  62. ;
  63. fceil_x tfr     x0,b    x1,a            ;get mx,ex
  64. fceil_a
  65.         neg     a                       ;reverse number line
  66.         jsr     floor_a                 ;do floor operation
  67.         neg     a                       ;reverse number line
  68.         rts
  69.  
  70.  
  71.  
  72.  
  73.  
  74.